import './style.scss'
import 'normalize.css'

import config from './config'

import { imageResources } from './service/image'

import straw from './canvas/straw'
import wall from './canvas/wall'
import water from './canvas/water'
import steel from './canvas/steel'
import tank from './canvas/tank'
import bullet from './canvas/bullet'

const app = document.querySelector<HTMLDivElement>('#app')!
app.style.width = `${config.canvas.width}px`
app.style.height = `${config.canvas.height}px`

const bootstrap = async () => {
    // 加载图片资源
    await Promise.all(imageResources)
    // 渲染墙
    wall.render()
    // 渲染水
    water.render()
    // 渲染白墙
    steel.render()
    // 渲染草地
    straw.render()

    // 渲染坦克
    tank.render()

    bullet.render()
}

bootstrap()
